<%@ page import="com.dao.UserDao" %>
<%@ page import="com.bean.User" %>
<%@ page import="java.io.PrintWriter" %>
<%@ page import="com.bean.Group" %>
<%@ page import="com.dao.GroupDao" %>
<%@ page language="java" contentType="text/html; charset=utf-8"
         pageEncoding="utf-8"%>
<%
  String qq = request.getParameter("qq");
  String v = request.getParameter("v");
  String groupQQ = request.getParameter("groupQQ");
  UserDao userDao = new UserDao();
  GroupDao groupDao = new GroupDao();
  User user = userDao.findOne(qq);
  PrintWriter writer =response.getWriter();
  Group group = groupDao.getGroupOneByQQ(groupQQ);
  if(group.getUserId()==user.getId()){
      writer.write("-1");
  }else {
    if(v!="1"){ //删除
      groupDao.deleteUser(group.getId(),user.getId());
    }
    writer.write("1");
  }
  writer.close();
%>